/// @tags: SpinConvex
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define rint register int

using std::cin;
using std::cout;
using std::max;

namespace BlueQuantum {

typedef long long LL;

constexpr int MAXN = 5e4 + 3, INF = 0x3f3f3f3f;

struct Point {
  int x, y;
} p0, p[MAXN], stk[MAXN];

int n, top;

inline bool cmp(const Point &a, const Point &b) {
  double A = atan2(a.y - p0.y, a.x - p0.x);
  double B = atan2(b.y - p0.y, b.x - p0.x);
  return A != B ? A < B : a.x < b.x;
}

inline LL cross(int x1, int y1, int x2, int y2) { return (LL)x1 * y2 - (LL)x2 * y1; }

inline LL compare(const Point &a, const Point &b, const Point &c) {
  return cross(b.x - a.x, b.y - a.y, c.x - a.x, c.y - a.y);
}

inline void getConvex() {
  p0 = Point{INF, INF};
  int k = 0;
  for (rint i = 0; i < n; ++i)
    if (p0.y > p[i].y || (p0.y == p[i].y && p0.x > p[i].x)) p0 = p[i], k = i;
  std::swap(p[k], p[0]);
  std::sort(p + 1, p + n, cmp);
  stk[0] = p[0];
  stk[1] = p[1];
  top = 1;
  for (int i = 2; i < n; ++i) {
    while (top && compare(stk[top - 1], p[i], stk[top]) >= 0) top--;
    stk[++top] = p[i];
  }
}

inline LL getDis(const Point &a, const Point &b) {
  return LL(a.x - b.x) * (a.x - b.x) + LL(a.y - b.y) * (a.y - b.y);
}

inline LL getDiameter() {
  LL res = 0;
  if (top == 1) return getDis(stk[0], stk[1]);
  stk[++top] = stk[0];
  for (rint i = 0, j = 2; i < top; ++i) {
    while (compare(stk[i], stk[i + 1], stk[j]) < compare(stk[i], stk[i + 1], stk[j + 1]))
      j = (j + 1) % top;
    res = max(res, max(getDis(stk[i], stk[j]), getDis(stk[i + 1], stk[j])));
  }
  return res;
}

inline int main() {
  cin >> n;
  for (rint i = 0; i < n; ++i) {
    cin >> p[i].x >> p[i].y;
  }
  getConvex();
  cout << getDiameter();
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("SpinConvex.in", "r", stdin);
  freopen("SpinConvex.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
